package com.whq.thrift.api.kafka.requestlog.db;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.whq.thrift.api.common.thriftserver.ResponseDataMapBase;

public class RequestLog implements Serializable {

	private static final long serialVersionUID = 1L;

	private int id;
	private long time = 0l;
	private Date timestamp;

	private String phone;
	private String mid;
	private String sndaId;
	private String host;
	private String devicedId;
	private String network;
	private String macAddress;
	private String flowId;
	private String requestParams;
	private int verifyCode;
	private Date createTime;
	private String api;
	private String appVersion;
	private int osType;
	private String osVersion;
	private String deviceModel;
	private String extend1;
	private String extend2;
	private String extend3;
	private String extend4;
	private String extend5;
	
	private Long cost;
	private String resultCode;

	private Map<String, String> params;
	private ResponseDataMapBase verifyResult;

	public int getTableSeq() {
		int ret = 100;

		Date t = null;
		if (this.timestamp == null) {
			t = new Date();
		} else {
			t = timestamp;
		}
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(t);
		return ret + calendar.get(Calendar.DAY_OF_MONTH);
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
		this.timestamp = new Date(time);
	}

	public Date getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getMid() {
		return mid;
	}

	public void setMid(String mid) {
		this.mid = mid;
	}

	public String getSndaId() {
		return sndaId;
	}

	public void setSndaId(String sndaId) {
		this.sndaId = sndaId;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public String getDevicedId() {
		return devicedId;
	}

	public void setDevicedId(String devicedId) {
		this.devicedId = devicedId;
	}

	public String getNetwork() {
		return network;
	}

	public void setNetwork(String network) {
		this.network = network;
	}

	public String getMacAddress() {
		return macAddress;
	}

	public void setMacAddress(String macAddress) {
		this.macAddress = macAddress;
	}

	public String getFlowId() {
		return flowId;
	}

	public void setFlowId(String flowId) {
		this.flowId = flowId;
	}

	public String getRequestParams() {
		return requestParams;
	}

	public void setRequestParams(String requestParams) {
		this.requestParams = requestParams;
	}

	public int getVerifyCode() {
		return verifyCode;
	}

	public void setVerifyCode(int verifyCode) {
		this.verifyCode = verifyCode;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getApi() {
		return api;
	}

	public void setApi(String api) {
		this.api = api;
	}

	public String getAppVersion() {
		return appVersion;
	}

	public void setAppVersion(String appVersion) {
		this.appVersion = appVersion;
	}

	public int getOsType() {
		return osType;
	}

	public void setOsType(int osType) {
		this.osType = osType;
	}

	public String getOsVersion() {
		return osVersion;
	}

	public void setOsVersion(String osVersion) {
		this.osVersion = osVersion;
	}

	public String getDeviceModel() {
		return deviceModel;
	}

	public void setDeviceModel(String deviceModel) {
		this.deviceModel = deviceModel;
	}

	public String getExtend1() {
		return extend1;
	}

	public void setExtend1(String extend1) {
		this.extend1 = extend1;
	}

	public String getExtend2() {
		return extend2;
	}

	public void setExtend2(String extend2) {
		this.extend2 = extend2;
	}

	public String getExtend3() {
		return extend3;
	}

	public void setExtend3(String extend3) {
		this.extend3 = extend3;
	}

	public String getExtend4() {
		return extend4;
	}

	public void setExtend4(String extend4) {
		this.extend4 = extend4;
	}

	public String getExtend5() {
		return extend5;
	}

	public void setExtend5(String extend5) {
		this.extend5 = extend5;
	}

	public Map<String, String> getParams() {
		return params;
	}

	public void setParams(Map<String, String> params) {
		this.params = params;
	}

	public ResponseDataMapBase getVerifyResult() {
		return verifyResult;
	}

	public void setVerifyResult(ResponseDataMapBase verifyResult) {
		this.verifyResult = verifyResult;
	}

	/**
	 * 获取所有的表的序号
	 * 
	 * @return
	 */
	public static List<Integer> getAllTableSeqList() {
		List<Integer> retList = new ArrayList<Integer>(0);
		for (int i = 101; i <= 131; i++) {
			retList.add(i);
		}
		return retList;
	}

	public Long getCost() {
		if (cost == null) {
			return 0l;
		}
		return cost;
	}

	public void setCost(Long cost) {
		this.cost = cost;
	}

	public String getResultCode() {
		return resultCode;
	}

	public void setResultCode(String resultCode) {
		this.resultCode = resultCode;
	}

}
